ACF: The autocorrelation function (ACF) defines how data points in a time series are related, on average, to the preceding data points (Box, Jenkins, & Reinsel, 1994). In other words, it measures the self-similarity of the signal over different delay times. Accordingly, the ACF is a function of the delay or lag Ï„, which determines the time shift taken into the past to estimate the similarity between data points. https://en.wikipedia.org/wiki/Autocorrelation
PACF: The partial autocorrelation at lag k is the correlation that results after removing the effect of any correlations due to the terms at shorter lags. https://en.wikipedia.org/wiki/Partial_autocorrelation_function
In signal processing, cross-correlation is a measure of similarity of two series as a function of the displacement of one relative to the other.
Alt Text
The Granger causality test is a statistical hypothesis test for determining whether one time series is useful in forecasting another, first proposed in 1969. Let y and x be stationary time series. To test the null hypothesis that x does not Granger-cause y, one first finds the proper lagged values of y to include in an univariate autoregression of y:
\[{\displaystyle y_{t}=a_{0}+a_{1}y_{t-1}+a_{2}y_{t-2}+\cdots +a_{m}y_{t-m}+{\text{error}}_{t}.}\] Next, the autoregression is augmented by including lagged values of x:
\[{\displaystyle y_{t}=a_{0}+a_{1}y_{t-1}+a_{2}y_{t-2}+\cdots +a_{m}y_{t-m}+b_{p}x_{t-p}+\cdots +b_{q}x_{t-q}+{\text{error}}_{t}.}\]
One retains in this regression all lagged values of x that are individually significant according to their t-statistics, provided that collectively they add explanatory power to the regression according to an F-test (whose null hypothesis is no explanatory power jointly added by the x’s). In the notation of the above augmented regression, p is the shortest, and q is the longest, lag length for which the lagged value of x is significant.
The null hypothesis that x does not Granger-cause y is accepted if and only if no lagged values of x are retained in the regression.
## Granger causality test
##
## Model 1: AQI_i ~ Lags(AQI_i, 1:33) + Lags(AQI_o, 1:33)
## Model 2: AQI_i ~ Lags(AQI_i, 1:33)
## Res.Df Df F Pr(>F)
## 1 3927
## 2 3960 -33 2.0808 0.0002903 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## Granger causality test
##
## Model 1: AQI_i ~ Lags(AQI_i, 1:26) + Lags(AQI_o, 1:26)
## Model 2: AQI_i ~ Lags(AQI_i, 1:26)
## Res.Df Df F Pr(>F)
## 1 3948
## 2 3974 -26 2.2946 0.0002023 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## [1] "125627 is leaky because Pr(>F) = 0.000202329368051083 <0.05"
## Granger causality test
##
## Model 1: AQI_i ~ Lags(AQI_i, 1:2) + Lags(AQI_o, 1:2)
## Model 2: AQI_i ~ Lags(AQI_i, 1:2)
## Res.Df Df F Pr(>F)
## 1 4020
## 2 4022 -2 3.2707 0.03808 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## Granger causality test
##
## Model 1: AQI_i ~ Lags(AQI_i, 1:2) + Lags(AQI_o, 1:2)
## Model 2: AQI_i ~ Lags(AQI_i, 1:2)
## Res.Df Df F Pr(>F)
## 1 4020
## 2 4022 -2 10.391 3.155e-05 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## [1] "127177 is leaky because Pr(>F) = 3.15498609819007e-05 <0.05"
## Granger causality test
##
## Model 1: AQI_i ~ Lags(AQI_i, 1:1) + Lags(AQI_o, 1:1)
## Model 2: AQI_i ~ Lags(AQI_i, 1:1)
## Res.Df Df F Pr(>F)
## 1 4023
## 2 4024 -1 0.3232 0.5697
## Granger causality test
##
## Model 1: AQI_i ~ Lags(AQI_i, 1:9) + Lags(AQI_o, 1:9)
## Model 2: AQI_i ~ Lags(AQI_i, 1:9)
## Res.Df Df F Pr(>F)
## 1 3999
## 2 4008 -9 2.837 0.002489 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## [1] "127187 is leaky because Pr(>F) = 0.00248906586245564 <0.05"
## Granger causality test
##
## Model 1: AQI_i ~ Lags(AQI_i, 1:2) + Lags(AQI_o, 1:2)
## Model 2: AQI_i ~ Lags(AQI_i, 1:2)
## Res.Df Df F Pr(>F)
## 1 4020
## 2 4022 -2 7.5486 0.0005344 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## Granger causality test
##
## Model 1: AQI_i ~ Lags(AQI_i, 1:1) + Lags(AQI_o, 1:1)
## Model 2: AQI_i ~ Lags(AQI_i, 1:1)
## Res.Df Df F Pr(>F)
## 1 4023
## 2 4024 -1 23.682 1.18e-06 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## [1] "127221 is leaky because Pr(>F) = 1.18005906683864e-06 <0.05"
## Granger causality test
##
## Model 1: AQI_i ~ Lags(AQI_i, 1:1) + Lags(AQI_o, 1:1)
## Model 2: AQI_i ~ Lags(AQI_i, 1:1)
## Res.Df Df F Pr(>F)
## 1 4022
## 2 4023 -1 9.8204 0.001738 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## Granger causality test
##
## Model 1: AQI_i ~ Lags(AQI_i, 1:3) + Lags(AQI_o, 1:3)
## Model 2: AQI_i ~ Lags(AQI_i, 1:3)
## Res.Df Df F Pr(>F)
## 1 4016
## 2 4019 -3 17.383 3.271e-11 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## [1] "127227 is leaky because Pr(>F) = 3.27109901425545e-11 <0.05"
## Granger causality test
##
## Model 1: AQI_i ~ Lags(AQI_i, 1:2) + Lags(AQI_o, 1:2)
## Model 2: AQI_i ~ Lags(AQI_i, 1:2)
## Res.Df Df F Pr(>F)
## 1 4016
## 2 4018 -2 3.061 0.04695 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## Granger causality test
##
## Model 1: AQI_i ~ Lags(AQI_i, 1:1) + Lags(AQI_o, 1:1)
## Model 2: AQI_i ~ Lags(AQI_i, 1:1)
## Res.Df Df F Pr(>F)
## 1 4019
## 2 4020 -1 11.32 0.0007739 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## [1] "127303 is leaky because Pr(>F) = 0.000773892952366537 <0.05"